import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_excel('dataset.xlsx', header=None)
from matplotlib.font_manager import FontProperties
plt.rcParams['axes.unicode_minus'] = False
plt.rcParams['axes.formatter.useoffset'] = False
plt.rcParams['font.sans-serif']=['SimHei']
plt.legend(prop=FontProperties(fname='SimHei'))  # 设置图例中文
current_axes=plt.axes()
current_axes.xaxis.set_visible(False)
current_axes.yaxis.set_visible(False)
# 根据聚类编号绘制不同颜色的线
for cluster_id, group in df.groupby(1):
        plt.plot(group[2],[0]*len(group[2]),label=f'类{cluster_id}')

plt.legend()
plt.savefig('datasee.jpg',dpi=500)
plt.show()